package com.xwj.controller;

import com.xwj.domain.Item;
import com.xwj.service.CacheItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xwj
 * @date 2020/4/27
 */
@RestController
public class ItemController {
    @Autowired
    private CacheItemService cacheItemService;
    @GetMapping("/item/info")
    @ResponseBody
    public Item getItemByCode(String code) throws Exception {
        return cacheItemService.getItemByCode(code);
    }
}
